import type { EnterpriseChildItem, EnterpriseDetail, EnterpriseListData, EnterpriseListParams, IndustryItem } from "@/types/enterprise";
import RequestAxios from "@/utils/request";

/**
 * 获取企业列表
 * **/


export const getEnterPriseListAPI = (params: EnterpriseListParams) => RequestAxios.get<EnterpriseListData>("/park/enterprise", params)

/**
 * 获取所属行业列表
 * **/
export const getIndustryListAPI = () => RequestAxios.get<IndustryItem[]>("/park/industry")

/*
 新增企业
**/
export const addEnterPriseAPI = (data: EnterpriseDetail) => RequestAxios.post<null>("/park/enterprise", data)


/***
 * 获取企业详情
 * **/

export const getEnterPriseDetailAPI = (id: string) => RequestAxios.get<EnterpriseDetail>(`/park/enterprise/${id}`)

/****
 * 
 *  编辑接口
 * **/

export const updateEnterPriseAPI = (data: EnterpriseDetail) => RequestAxios.put<null>(`/park/enterprise`, data)


/**
 * 获取企业展开的信息列表
 * **/

export const getEnterPriseChildList = (id: string) => RequestAxios.get<EnterpriseChildItem[]>(`/park/enterprise/rent/${id}`)